#include "led.h"

Led::Led(uint8_t p) : pin(p), state(false) {
    pinMode(pin, OUTPUT);
}

void Led::on() {
    state = true;
    digitalWrite(pin, HIGH);
}

void Led::off() {
    state = false;
    digitalWrite(pin, LOW);
}

void Led::toggle() {
    state = !state;
    digitalWrite(pin, state ? HIGH : LOW);
}